import java.io.Serializable;

/**
 * The Message class represents the message objects
 * that are sent from clientside to serverside, and back to client again.
 *
 * @author BluJaded Team
 * @version (see Sourceforge.net)
 */
public class Message implements Serializable {

    // the text of the message that is sent
    private String content = "";

    // boolean value used to mark a message object as a command to quit for the sending client.
    private boolean quit = false;

    // boolean value used to mark a message object as a command to quit for the Server
    private boolean serverQuit = false;

    // optional string nickname to represent a specific Client to exclude from message,
    // or explicitly send a message to when combined with the only variable
    // also used to initiate whisper mode
    private String msgTo = "";

    // boolean used to determine if the msgTo variable is used to exclude or explicitly send a Client a Message
    private boolean only = false;

    // String to represent the nickname of the Client whom the message originates when used for a whisper
    // also used in conjunction with other variables to deliver a result of a whisper attempt to a Client
    // and to update the modeLabel of the Client GUI
    private String msgFrom = "";

    // variable used to control, change and maintain the nickname of a Client
    private String nick = "";

    // boolean value used to mark a message as a command for displaying the connected Clients to the user
    private boolean listClients = false;

    // String used to hold the list of currently connected Clients to display to the user
    private String connected = "";

    // boolean value used to mark a message as a whisper when sent to a client
    // also used to suppress mode change conformation when sent to a ClientHandler
    private boolean wisp = false;

    // boolean value used to mark a message as a end whisper mode command
    private boolean endWisp = false;

    // boolean value used to denote if a /w <nickname> <message> has in finding the whisper target and may procceed
    private boolean wispSuccess;

    // boolean value used to mark a message as a command to display help text to the user
    private boolean help = false;

    /**
     * Constructor for objects of Message class.
     */
    public Message()
    {
    }

    /**
     * Gets the content of the message.
     * @return the content of the message
     */
    public String getContent() {
        return content;
    }

    /**
     * Sets the content of the message.
     * @param myContent     the content to set
     */
    public void setContent(String myContent) {
        content = myContent;
    }

    /**
     * Gets the value of quit.
     * @return the value of quit
     */
    public boolean getQuit() {
        return quit;
    }

    /**
     * Sets the value of quit.
     * @param myQuit    the quit value to set
     */
    public void setQuit(boolean myQuit) {
        quit=myQuit;
    }

    /**
     * Gets the value of serverQuit.
     * @return the value of quit
     */
    public boolean getServerQuit() {
        return serverQuit;
    }

    /**
     * Sets the value of serverQuit.
     * @param myServerQuit  the serverQuit value to set
     */
    public void setServerQuit(boolean myServerQuit) {
        serverQuit=myServerQuit;
    }

    /**
     * Gets the value of nick.
     * @return the value of nick
     */
    public String getNick() {
        return nick;
    }

    /**
     * Sets the value of nick.
     * @param myNick    the nick value to set
     */
    public void setNick(String myNick) {
        nick=myNick;
    }

    /**
     * Gets the value of msgTo.
     * @return the value of msgTo
     */
    public String getMsgTo() {
        return msgTo;
    }

    /**
     * Sets the value of msgTo.
     * @param to    the msgTo value to set
     */
    public void setMsgTo(String to) {
        msgTo=to;
    }

    /**
     * Gets the value of only.
     * @return the value of only
     */
    public boolean getOnly() {
        return only;
    }

    /**
     * Sets the value of only.
     * @param myOnly    the only value to set
     */
    public void setOnly(boolean myOnly) {
        only=myOnly;
    }

    /**
     * Gets the value of listClients.
     * @return the value of listClients
     */
    public boolean getListClients() {
        return listClients;
    }

    /**
     * Sets the value of listClients.
     * @param myList    the listClients value to set
     */
    public void setListClients(boolean myList) {
        listClients=myList;
    }


    /**
     * Gets the value of msgFrom.
     * @return the value of msgFrom
     */
    public String getMsgFrom() {
        return msgFrom;
    }

    /**
     * Sets the value of msgFrom.
     * @param from  the msgFrom value to set
     */
    public void setMsgFrom(String from) {
        msgFrom=from;
    }

    /**
     * Gets the value of connected.
     * @return the value of connected
     */
    public String getConnected() {
        return connected;
    }

    /**
     * Sets the value of connected.
     * @param areConnected  the connected value to set
     */
    public void setConnected(String areConnected) {
        connected=areConnected;
    }


    /**
     * Gets the value of wisp.
     * @return the value of wisp
     */
    public boolean getWisp() {
        return wisp;
    }

    /**
     * Sets the value of wisp.
     * @param myWisp    the wisp value to set
     */
    public void setWisp(boolean myWisp) {
        wisp=myWisp;
    }

    /**
     * Gets the value of endWisp.
     * @return the value of endWisp
     */
    public boolean getEndWisp() {
        return endWisp;
    }

    /**
     * Sets the value of endWisp.
     * @param myEndWisp     the endWisp value to set
     */
    public void setEndWisp(boolean myEndWisp) {
        endWisp=myEndWisp;
    }

    /**
     * Gets the value of wispSuccess.
     * @return the value of wispSuccess
     */
    public boolean getWispSuccess() {
        return wispSuccess;
    }

    /**
     * Sets the value of wispSuccess.
     * @param myWispSuccess     the wispSuccess value to set
     */
    public void setWispSuccess(boolean myWispSuccess) {
        wispSuccess=myWispSuccess;
    }

    /**
     * Gets the value of help.
     * @return the value of help
     */
    public boolean getHelp() {
        return help;
    }

    /**
     * Sets the value of help.
     * @param myHelp    the help value to set
     */
    public void setHelp(boolean myHelp) {
        help=myHelp;
    }
}
